package common;

import java.io.Serializable;
import java.util.List;

import common.Tables.Table;
/**
 * the answer of the Command from the Server to the Client 
 * @author Orit
 *
 */
public class CommandAnswer implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private List<Table> listTableAns ;	   //hold list of table - the answer
	private List<Table> listTableSecAns;  //hold second list of table - second answer if needed
	private String errorMessage; 		  //if it is null there is no Error Message.
	
	
	private List<List<Table>> listOfSetTableAns ;
	
	/**
	 * C'tor
	 */
	public CommandAnswer() {
		errorMessage=null;
		listTableAns =null;
	}
	
	/**
	 * @return the Table just if there is no Errors else return null.
	 */
	public List<Table> getListTableAns() {
		if (errorMessage==null)
			return listTableAns;
		return null;
	}
	
	//////////////---------Getters && Setters------//////////////////
	public void setListTableAns(List<Table> listTableAns) {
		this.listTableAns = listTableAns;
	}

	public void setErrorMessege(String errorMessege) {
		this.errorMessage = errorMessege;
	}
	public String getErrorMessege() {
		return errorMessage;
	}

	public void setListOfSetTableAns(List<List<Table>> listOfSetTableAns) {
		this.listOfSetTableAns = listOfSetTableAns;
	}

	public List<List<Table>> getListOfSetTableAns() {
		return listOfSetTableAns;
	}

	public void setListTableSecAns(List<Table> listTableSecAns) {
		this.listTableSecAns = listTableSecAns;
	}

	public List<Table> getListTableSecAns() {
		return listTableSecAns;
	}
}
